<div class="layui-form" lay-filter="layuiadmin-form-admin" style="padding: 20px 30px 0 0;">

  <div class="layui-form-item">
    <label class="layui-form-label">DM</label>
    <div class="layui-input-inline">
      <script type="text/html" template>
        <select name="dmId" lay-verify="required" id="dmId">
            <option value="{{d.params.dmId || ''}}">{{d.params.dmName || '请选择' }}</option>
        </select>
      </script>
    </div>
  </div>


  <div class="layui-form-item">
    <label class="layui-form-label"></label>
    <div class="layui-input-inline">
      <input type="button" lay-submit lay-filter="LAY-user-back-submit" value="确认" class="layui-btn">
    </div>
  </div>
</div>



<script>
  layui.use(['admin', 'form', 'upload'], function () {
    var $ = layui.$
      , setter = layui.setter
      , form = layui.form
      , upload = layui.upload;

    $.ajax({
      url: setter.request.baseUrl + "dm/list?limit=1000&page=1",
      type: 'get',
      contentType: "application/json",
      headers: {
        token: layui.data("layuiAdmin").token
      },
      data: {
      },
      success: function (data) {
        var list = data.dm
        for (var i = 0; i < list.length; i++) {

          $("#dmId").append("<option value='" + list[i].id + "'>" + list[i].name + "</option>");
        }
        layui.use('form', function () {
          var form = layui.form;
          form.render();
        });
      },
      error: function () {
      },
    })
  })
</script>